package com.fun.feifun.modules.business.model;

import com.baomidou.mybatisplus.annotation.IdType;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fun.feifun.base.BaseEntity;
import com.fun.feifun.modules.business.model.dto.BusinessUserDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * <p>
 * 业务代理用户
 * </p>
 *
 * @author wkf
 * @since 2024-05-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="BusinessUser对象", description="业务代理用户")
public class BusinessUser extends BaseEntity {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "名称")
    private String nickName;

    @ApiModelProperty(value = "用户名")
    private String userName;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "编码")
    private String code;

    @ApiModelProperty(value = "类型")
    private Integer type;

    @ApiModelProperty(value = "联系人")
    private String contactName;

    @ApiModelProperty(value = "联系人电话")
    private String contactPhone;

    @ApiModelProperty(value = "余额")
    private BigDecimal amount;

    @ApiModelProperty(value = "授信额度")
    private BigDecimal creditAmount;

    @ApiModelProperty(value = "订单锁定金额")
    private BigDecimal lockAmount;

    @ApiModelProperty(value = "密匙")
    private String secretKey;

    @ApiModelProperty(value = "最后登录时间")
    private LocalDateTime lastLoginTime;

    @ApiModelProperty(value = "0停用，1启用")
    private Boolean isEnable;

    @ApiModelProperty(value = "0未删除，1已经删除")
    private Boolean delFlag;

    public BusinessUserDto toDto(){
        BusinessUserDto dto=new BusinessUserDto();
        BeanUtils.copyProperties(this,dto);
        return dto;
    }
}
